package lx4;

public class sol extends Thread{
    private static int cnt = 0;
    private static final Object ll = new Object();

    @Override
    public void run() {
        while(true){
            synchronized (ll){
                if(cnt == 100)break;
                if((cnt & 1) == 1){
                    System.out.println(this.getName() + "  " + cnt);
                }
                cnt ++;
                try {
                    Thread.sleep(10);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }
    }
}
